//
//  DefineHead.h
//  ZhiHuDaily
//
//  Created by 吴宜昊 on 2022/2/4.
//

#ifndef DefineHead_h
#define DefineHead_h


#define IMAGE(name) [UIImage imageNamed:[NSString stringWithFormat:@"%@", name]]

#define ImageDefault IMAGE(@"icon_default")

#define RGB(r, g, b)        [UIColor colorWithRed:r/255.0f green:g/255.0f blue:b/255.0f alpha:1]
#define RGBA(r, g, b, a)    [UIColor colorWithRed:r/255.0f green:g/255.0f blue:b/255.0f alpha:a]
#define HEXCOLOR(c)  [UIColor colorWithRed:((c>>16)&0xFF)/255.0 green:((c>>8)&0xFF)/255.0 blue:(c&0xFF)/255.0 alpha:1.0]

#define kClearColor     [UIColor clearColor]

#define kScreenBounds    [UIScreen mainScreen].bounds
#define kScreenWidth    [UIScreen mainScreen].bounds.size.width
#define kScreenHeight   [UIScreen mainScreen].bounds.size.height

#define FontPingFangRegular(a)      [UIFont fontWithName:@"PingFangSC-Regular" size:a]
#define FontPingFangLight(a)        [UIFont fontWithName:@"PingFangSC-Light" size:a]
#define FontPingFangMedium(a)       [UIFont fontWithName:@"PingFangSC-Medium" size:a]

#define kStatusBarHeight [[UIApplication sharedApplication] statusBarFrame].size.height
#define kNavBarHeight 44.0
#define kTabBarHeight (kStatusBarHeight > 20 ? 83 : 49)
#define kTopHeight (kStatusBarHeight + kNavBarHeight)
#define IsBangs kStatusBarHeight != 20
#define VirtualH ( IsBangs ? 34 : 0 )

#define WeakSelf(a) __weak typeof(a) weakSelf = a
#define StrongSelf(a) __strong typeof(a) strongSelf = a

#endif /* DefineHead_h */
